package cn.com.scitc.licenseplateback.model;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "LdleParking", schema = "CubeLibrary", catalog = "")
public class LdleParkingEntity {
    private int autoNumber;
    private String cubeLibraryNumber;
    private String region;
    private int arrangement;
    private String number;

    @Id
    @Column(name = "AutoNumber", nullable = false)
    public int getAutoNumber() {
        return autoNumber;
    }

    public void setAutoNumber(int autoNumber) {
        this.autoNumber = autoNumber;
    }

    @Basic
    @Column(name = "CubeLibraryNumber", nullable = false, length = 32)
    public String getCubeLibraryNumber() {
        return cubeLibraryNumber;
    }

    public void setCubeLibraryNumber(String cubeLibraryNumber) {
        this.cubeLibraryNumber = cubeLibraryNumber;
    }

    @Basic
    @Column(name = "Region", nullable = false, length = 1)
    public String getRegion() {
        return region;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    @Basic
    @Column(name = "Arrangement", nullable = false)
    public int getArrangement() {
        return arrangement;
    }

    public void setArrangement(int arrangement) {
        this.arrangement = arrangement;
    }

    @Basic
    @Column(name = "Number", nullable = true, length = 145)
    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LdleParkingEntity that = (LdleParkingEntity) o;
        return autoNumber == that.autoNumber &&
                arrangement == that.arrangement &&
                Objects.equals(cubeLibraryNumber, that.cubeLibraryNumber) &&
                Objects.equals(region, that.region) &&
                Objects.equals(number, that.number);
    }

    @Override
    public int hashCode() {
        return Objects.hash(autoNumber, cubeLibraryNumber, region, arrangement, number);
    }

    @Override
    public String toString() {
        return "LdleParkingEntity{" +
                "autoNumber=" + autoNumber +
                ", cubeLibraryNumber='" + cubeLibraryNumber + '\'' +
                ", region='" + region + '\'' +
                ", arrangement=" + arrangement +
                ", number='" + number + '\'' +
                '}';
    }
}
